//
//  YXDatePickerVC.m
//  YXKitOC
//
//  Created by zhxin on 2020/11/9.
//  Copyright © 2020 张鑫. All rights reserved.
//

#import "YXDatePickerVC.h"
#import "YXTableView.h"
#import "YXKitOC.h"
#import "YXCarDatePicker.h"

@interface YXDatePickerVC ()

@property (nonatomic, strong) NSArray *listArray; /**< <#描述#> */
@property (nonatomic, strong) YXTableView *yxTableView; /**< <#描述#> */

@end

@implementation YXDatePickerVC

#pragma mark - Life Cycle

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.listArray = @[@"上牌时间", @"出厂日期"];
    
    [self.view addSubview:self.yxTableView];
    [self.yxTableView reloadData];
}

- (void)dealloc {
    
}

#pragma mark - Navigation

#pragma mark - Event

///** 注释 */
//- (void)click<#描述#>Button:(UIButton *)btn {
//
//}

///** 注释 */
//- (void)didTap***View:(UIGestureRecognizer *)gestureRecognizer {
//
//}

#pragma mark - Public Func

///** 注释 */
//- (void)push<#描述#>ViewController {
//
//}

#pragma mark - Private Func

#pragma mark  UI & Data

#pragma mark  Request

#pragma mark  Functions

#pragma mark - Notification

///** 注释 */
//- (void)didRecieved<#名称#>Notification:(NSNotification *)notification {
//
//}

#pragma mark - Custom Delegate

#pragma mark  *****Delegate

#pragma mark - System Delegate

#pragma mark  *****Delegate

#pragma mark - Getter

- (YXTableView *)yxTableView {
    if (!_yxTableView) {
        _yxTableView = [[YXTableView alloc] initWithFrame:YX_SafeFrame()];
        
        YX_WeakSelf
        [_yxTableView registCells:@[[YXBaseCell class]] returnClass:^Class _Nonnull(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
            return [YXBaseCell class];
        } loadCell:^(UITableView * _Nonnull tableView, id  _Nonnull loadCell, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
            
            YXBaseCell *cell = loadCell;
            cell.textLabel.text = cellData;
            
        } returnHeight:^CGFloat(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
            return 44;
        } didSelected:^(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
            
            [tableView deselectRowAtIndexPath:indexPath animated:YES];
            
            YXCarDatePicker *datePicker = [[YXCarDatePicker alloc] initWithDateStyle:YXDatePickerViewType_yyyyMM completeBlock:^(NSDate * _Nonnull date) {
                YX_HUDShowMessage([date yx_dateToStringWithFormat:@"yyyy-MM"]);
            }];
            datePicker.carViewType = indexPath.row;
            [datePicker show];
            
        } loadData:^(NSInteger pageIndex, NSInteger pageSize, YXStatusBlock  _Nonnull statusBlock) {
            statusBlock(nil, weakSelf.listArray);
        }];
    }
    return _yxTableView;
}

#pragma mark - Setter

@end
